<div class="container">
{{if user:group_id == 1}}
{{if rooms}}
<div class="tree" style="overflow:hidden">
<ul class="list so-do">
{{rooms}}
</ul>
</div>
{{endif}}
<div class="clr"></div>
{{endif}}
{{if filter}}
<div id="filters">
<?php echo form_open();?>	
	<?php if(isset($employees_select)) { ?>
	<!--danh sach nhan vien phong ban-->
	<?php echo form_dropdown('user_id',array(''=>'---'.lang('profile:employees').'---') + $employees_select,'','class="chosen" style="min-width:180px"'  ) ?>
	<?php 
		$m = date("m", strtotime("-1 month"));
		echo form_dropdown('month',$month_select,$m,'class="chosen" style="min-width:180px"'  ) ?>
	<?php } else { ?>
		<?php echo form_dropdown('month',array(''=>'---'.lang('global:all').'---') + $month_select,'','class="chosen" style="min-width:180px"'  ) ?>
	<?php } ?>
	<?php echo form_dropdown('year',array(''=>lang('salary:year')) + $year_select,date("Y"),'class="chosen" style="min-width:180px"'  ) ?>
	
	
<?php echo form_close();?>
</div>
{{endif}}
{{if !filter}}
<?php echo form_open('','class="form_input"')?>
<h3 class="title" style="margin-top:10px">{{title}}</h3>
<table class="tbl">

<thead>
	<tr>
		<th class="tc" style="width:5%">{{helper:lang line='global:stt'}}</th>
		<th style="width:35%;">{{helper:lang line='users:full_name'}}</th>
		<th style="width:20%" >{{helper:lang line='salary:{{method}}'}}</th>
		<th style="width:5%"><a title="{{helper:lang line='global:save'}}" class="save-pm">{{theme:image file = '_icon/admin/icon-32-save.png' }}</a></th>
	</tr>
</thead>
<tbody>
{{model}}
	<tr>
		<td>{{helper:count identifier}}</td>
		<td>
			{{ profile:display_name }}
			
		</td>
		<td>{{ profile:allows_1 }}</td>
		<td>
			<input type="hidden" class="user" value="{{profile:id}}"  />
			<input type="text" uid="{{profile:id}}" class="profile-key"  />
		</td>
	</tr>
{{/model}}
</tbody>
</table>
<?php echo form_close()?>
<script>
$('.profile-key').bind('keyup',function(){
	$uid = $(this).attr('uid');
	$(this).attr('name','allows_1['+$uid+']').addClass('updating');
});
//alert('{{method}}');
$('a.save-pm').click(function(){
	$data = $('.form_input').serialize();
	$method = '{{method}}';
	$.ajax({
		url:'{{url:site uri="emp_profile/salary/update_profile"}}',
		data:$data,
		type:'post',
		success:function(){
			location.reload();
		}
	});
});
//$('form.form_input').serialize()
</script>
{{endif}}
<div id="filter-stage">
	<?php template_partial('partial/plus_minus') ?>
</div>	
</div>